package com.foreknow.homework0928;

public class Point {
    // 1?????????????Point??????2?????????x??y?????x??y????2????????Point()??Point(intx0,y0),
    // ??????movePoint??int dx,int dy???????????λ???????????????Point????p1??p2??
    // ??????movePoint????????p1??p2??????
    private int x;
    private int y;

    public Point() {

    }

    public Point(int x0, int y0) {
        this.x = x0;
        this.y = y0;
    }

    public void movePoint(int dx, int dy) {
        for (int i = 1; i <= dy - 1; i++) {
            System.out.println("o");
        }
        for (int j = 1; j <= dx - 1; j++) {
            System.out.print("o ");
        }
        System.out.println("P");

    }

    public static void main(String[] args) {
        Point p1 = new Point(7, 9);
        for (int i = 1; i <= p1.y - 1; i++) {
            System.out.println("o");
        }
        for (int j = 1; j <= p1.x - 1; j++) {
            System.out.print("o ");
        }
        System.out.println("P");
        p1.movePoint(10, 15);
        Point p2 = new Point(4, 5);
        for (int i = 1; i <= p2.y - 1; i++) {
            System.out.println("o");
        }
        for (int j = 1; j <= p2.x - 1; j++) {
            System.out.print("o ");
        }
        System.out.println("P");
        p2.movePoint(10, 10);

    }
}
